package tests;

import common.Utils;
import org.openqa.selenium.By;

public class PracticePage extends Utils {
    public static String url = "http://49.235.61.184:8080/exercise";
    public PracticePage() {
        super(url);
    }

    //查看我都练习页面元素是否可见
    public void checkPracticePage() throws InterruptedException {
        //检查我的练习标题是否可见
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-pro-grid-content > div > div > div.ant-tabs.ant-tabs-top > div.ant-tabs-nav > div.ant-tabs-nav-wrap > div > div.ant-tabs-tab.ant-tabs-tab-active"));
        //检查我的练习标题旁边的文件夹小图标是否可见、
        driver.findElement(By.cssSelector("#rc-tabs-0-tab-undefined"));
        //检查状态连，查询、重置是否可见
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-pro-grid-content > div > div > div.ant-pro-table > div.ant-pro-card.ant-pro-table-search.ant-pro-table-search-query-filter > form > div"));
        //检查我的练习框是否可见
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-pro-grid-content > div > div > div.ant-pro-table > div:nth-child(2) > div"));
        System.out.println("我的练习页面，元素都可见");

        //点击文件夹按钮，检查跳转后的页面是否存在
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-pro-grid-content > div > div > div.ant-tabs.ant-tabs-top > div.ant-tabs-nav > div.ant-tabs-nav-wrap > div > div.ant-tabs-tab.ant-tabs-tab-active")).click();
        Thread.sleep(1000);
        //检查跳转后的页面状态狂、查询、重置按钮是否可见
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-pro-grid-content > div > div > div.ant-pro-table > div.ant-pro-card.ant-pro-table-search.ant-pro-table-search-query-filter > form"));
        //检查文件加的框是否可见
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-pro-grid-content > div > div > div.ant-pro-table > div:nth-child(2) > div"));
        System.out.println("文件夹页面元素都可见");

        //保存url
        detailUrl=driver.getCurrentUrl();




    }

}

